SAP OOPS ABAP Interview Questions

Ratings:
(4.8)
Views: 5421
Banner-Img
Share this blog:

Are you planning to attend an interview for the SAP OOPS ABAP role but confused on how to crack that interview and also what would be the most probable SAP OOPS ABAP Interview Questions that the interviewer may ask? Well, you have reached the right place. Tekslate has collected the most frequently asked SAP OOPS ABAP Interview Questions and Answers which are often asked in multiple interviews.

Most frequently asked SAP OOPS ABAP Interview Questions

SAP OOPS ABAP Interview Questions and Answers

Q1) What is OOPS ABAP?

Ans: Object orientation (OO), or to be more precise, object-oriented programming, is a problem-solving method in which the software solution reflects objects in the real world.

A comprehensive introduction to object orientation as a whole would go far beyond the limits of this introduction to ABAP Objects. This documentation introduces a selection of terms that are used universally in object orientation and also occur in ABAP Objects. In subsequent sections, it goes on to discuss in more detail how these terms are used in ABAP Objects. The end of this section contains a list of further reading, with a selection of titles about object orientation.

Q2) What is the difference between Class and Object?

Ans: A-Class is actually a blueprint or a template to create an Object. Whereas an object is an actual instance of a Class. 

Q3) How can polymorphism be implemented?

Ans: Implement polymorphism:

  • Method Overriding
  • Method Overloading
  • Operator Overloading

Q4) What is Inheritance?

Ans: In OOPs terminology, inheritance is a way to form new classes using classes that have already been defined. Inheritance is intended to help reuse existing code with little or no modification. The new classes, known as derived classes, inherit attributes and behaviour of the pre-existing classes, which are referred to as base classes.

Q5) What is Method Overriding?

Ans: Method overriding allows a subclass to override a specific implementation of a method that is already provided by one of its superclasses.

A subclass can give its own definition of methods but need to have the same signature as the method in its superclass. This means that when overriding a method the subclass method has to have the same name and parameter list as the super class's overridden method.

Q6) What is Method Overloading?

Ans: Method overloading is in a class have many methods having the same name but different parameters called overloading or static polymorphism.

Q7) What is Aggregation?

Ans: An aggregation is a special form of association. Aggregation is the composition of an object out of a set of parts. For example, a car is an aggregation of the engine, tires, brakes, etc.

Aggregation represents a "Has" relationship like a car has an engine.

Q8) What is an object-oriented programming language?

Ans: An object-oriented programming language allows concepts such as abstraction, modularity, encapsulation, polymorphism, and inheritance. Simula is the first object-oriented language. Objects are said to be the most important part of an object-oriented language. The concept revolves around making simulation programs around an object.

Want to represent real-time objects of a class, enroll in our SAP OOPS ABAP Training

Q9) What are the core ABAP oops concepts?

Ans:

Inheritance:

Inheritance is the ability of an object to inherit the properties and methods of another object. This characteristic leads to the creation of families of objects (just like families exist for humans) with parent objects and child objects.

Polymorphism:

Polymorphism is about an object's ability to provide context when methods or operators are called on the object. In object-oriented programming, polymorphism (from the Greek meaning "having multiple forms") is the characteristic of being able to assign a different meaning to a particular symbol or "operator" in different contexts. A simple example is two classes that inherit from a common parent and implement the same virtual method.

Encapsulation:

Encapsulation is the ability that an object has to contain and restrict access to its members. Encapsulation is a key concept of object programming that ensures the autonomy and integrity of the objects. Abstraction: Another OOPS concept related to encapsulation that is less widely used but gaining ground is an abstraction.

Abstraction:

Through the process of abstraction, a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency. In the same way that abstraction sometimes works in art, the object that remains is a representation of the original, with unwanted detail omitted. The resulting object itself can be referred to as an abstraction, meaning a named entity made up of selected attributes and behaviour specific to a particular usage of the originating entity.

Q10) What is UML?

Ans: UML (Unified Modeling Language) is a standardized modelling language. It is used for the specification, construction, visualization, and documentation of models for software systems and enables uniform communication between various users.

  • UML does not describe the steps in the object-oriented development process.
  • SAP uses UML as the company-wide standard for object-oriented modelling.
  • UML describes a number of different diagram types in order to represent different views of a system.

Q11) What are the types of Objects and Classes?

Ans:

There are two types of Objects:

  • Instance Objects
  • Static Objects.

Two types of Classes:

  • Instance class.
  • Static Class. 

Q12) What are the types of classes which can be created?

Ans:  We can create four types of classes under the final and only modelled category(optional) with private, protected, public, and abstract instantiation.

  • Usual Abap Class.
  • Exception Class(With/Without messages).
  • Persistent Class.
  • Test Class(ABAP Unit).

Q13) Mention the major differences between the Static Class and Singleton in Sap ABAP.

Ans: Understanding static components are essential before going to static classes in Sap ABAP Static Components: Static Components such as static attributes, static methods, and static events exists globally, it’s not necessary to create an instance/object of the class to access them, simply we can access them using static component selector =>. Singleton Class: The class that does not allow creating multiple instances to access any object. Static Class: The class that contains only static components without instance components is referred to as a static class.

Q14) What is a reference variable?

Ans: Objects can only be created and addressed using reference variables. Reference variables allow you to create and address objects. Reference variables can be defined in classes, allowing you to access objects from within a class.

Checkout our blog on  SAP ABAP Tutorial

Q15) What is an Object?

Ans: An object is an instance of a class. It has state, behaviour, and identity. It is also called an instance of a class.

Q16) What is meant by Binding?

Ans: Binding denotes the association of a name with a class.

Q17) What is meant by static binding?

Ans: Static binding is a binding in which the class association is made during compile time. This is also called Early binding.

Q18) What is meant by Dynamic binding?

Ans: Dynamic binding is a binding in which the class association is not made until the object is created at execution time. It is also called Late binding.

OOP ABAP Interview Questions

Q19) Define Modularity.

Ans: Modularity is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules.

Q20) What is meant by Persistence?

Ans: Persistence is the property of an object by which its existence transcends space and time.

Q21) What is collaboration?

Ans: Collaboration is a process whereby several objects cooperate to provide some higher-level behaviour.

Q22) What is a singleton?

Ans: If it is to be impossible to instantiate a class more than once (for example, because it serves as a data administrator or data container), you can use the singleton concept. The class is defined with the addition CREATE PRIVATE and FINAL and instantiated using its static constructor. A public static component could then make the reference to the class available to an external user.

Q23) What are the limitations of redefining a method?

Ans: Inherited methods can be redefined in subclasses Redefined methods must be re-implemented in subclasses. The signature of redefined methods cannot be changed Static methods cannot be redefined. In inheritance, static components are "shared": A class shares its non-private static attributes with all its subclasses. In ABAP Objects, you can not only add new components but also provide inherited methods with new implementations. This is known as redefinition. You can only redefine (public and protected) instance methods, other components (static methods, attributes and so on) cannot be redefined. Changes to method parameters (signature changes) are not possible.

Q24) What are static components? What is a component selector?

Ans: In inheritance, static components are "shared": A class shares its non-private static attributes with all its subclasses. => and -> are the component selectors used to refer.

Q25) What is the component instance?

Ans: A component instance is a running component that can be run in parallel with other instances of the same component.

Q26) How is Encapsulation implemented in OOPs?

Ans: Encapsulation means that the implementation of an object is hidden from other components in the system so that they cannot make assumptions about the internal status of the object and therefore dependencies on specific implementations do not arise.

Q27) What are BADIs? What are the BADI filters?

Ans: BADI - Business Add-Ins are enhancements to the standard version of the code of SAP.

Filter Badi- Business Add-Ins may be implemented on the basis of a filter value. If an enhancement for country-specific versions is provided for in the standard version, it is likely that different partners will want to implement this enhancement. Individual countries can create and activate their own implementation.

Q28) What is a functional Method?

Ans: Methods that have a RETURNING parameter are described as functional methods. These methods cannot have EXPORTING or CHANGING parameters but have many (or as few) IMPORTING parameters and exceptions as required.

Q29) What is a de-referenced variable? What is a garbage collector?

Ans: To go to an address before performing the operation a dereference variable is a pointer to the variable, not the variable itself. A pointer can be re-assigned any number of times while a reference cannot be reassigned after initialization. Field symbols are similar to dereference pointers. Thus, you can only access the content of the data object to which the field symbol points. (That is, field symbols use value semantics). If you want to access the content of the data object, you need to dereference the data reference first.

Read these latest SAP UI5 Interview Questions that help you grab high-paying jobs

Q30) In Java, How to make an object completely encapsulated?

Ans: All the instance variables should be declared as private and public getter and setter methods should be provided for accessing the instance variables.

Q31) How is polymorphism achieved in Java?

Ans: Inheritance, Overloading and Overriding are used to achieve Polymorphism in Java.

Q32) What are the advantages of OOPs?

Ans: The major advantages of OOPs are:

Feature Description
Simplicity Software objects model real-world objects, so the complexity is reduced and the program structure is very clear.
Modularity Each object forms a separate entity whose internal workings are decoupled from other parts of the system.
Modifiability It is easy to make minor changes in the data representation or the procedures in an OO program. Changes inside a class do not affect any other part of a program since the only public interface that the external world has to a class is through the use of methods.
Extensibility Adding new features or responding to changing operating environments can be solved by introducing a few new objects and modifying some existing ones.
 Maintainability Objects can be maintained separately, making locating and fixing problems easier.
Re-usability Objects can be reused in different programs

Q33) What are the main concepts of OOPs?

Ans: Following are the main concepts of OOPs:

  • Abstraction
  • Encapsulation
  • Inheritance
  • Polymorphism

Q34) What is Aggregation?

Ans: An aggregation is a special form of association. Aggregation is the composition of an object out of a set of parts. For example, a car is an aggregation of the engine, tires, brakes, etc.

Aggregation represents a "Has" relationship like a car has an engine.

Q35) What is the Association?

Ans: Association defines a relationship between different objects of different classes which allows one object instance to cause another to perform an action on its behalf.

ABAP OOPS Interview Questions

Q36) What is an object-oriented programming language?

Ans: Object-oriented programming language allows concepts such as abstraction, modularity, encapsulation, polymorphism, and inheritance. Simula is the first object-oriented language. Objects are said to be the most important part of an object-oriented language. The concept revolves around making simulation programs around an object.

Q37) What is message passing in object-oriented programming?

Ans: Message passing is a method by which an object sends data to another object or requests other objects to invoke the method. This is also known as interfacing. It acts as a messenger from one object to another object to convey specific instructions.

Also, Have a look at SAP ABAP Resume

Q38) What is Method Overloading?

Ans: Method overloading is the ability to define several methods all with the same name.

Q39) What is Operator Overloading?

Ans: Operator overloading is a specific case of polymorphisms in which some or all operators like +, -, %, etc. are treated as polymorphic functions and as such have different behaviors depending on the types of its operands.

Q40) What do you mean by Object Slicing?

Ans; When a derived class object is assigned to a base class, only the base class's part of the content in the derived object is copied to the base class, leaving behind the derived class-specific contents. This is referred to as Object Slicing.

Class Base
{
public int i;
};
class Derived: public Base
{
public int j;
};
int main()
{
Base objB;
Derived objD;
objB = objD;
//Here objD contains both i and j. 
//But only i is copied to objB.
}

Q41) Give some examples of programming languages that support object-oriented characteristics?

Ans: Some of the programming languages which support object-oriented characteristics are ABAP, C++, Perl, LISP, Java, C#, Tcl, VB.Net, Ruby, Python, PHP, etc. The popularity of these languages has increased considerably as they can solve complex problems with ease.

Q42) What is a constructor?

Ans: A constructor is an operation that creates an object and/or initializes its state.

Checkout: [SAP BI ABAP Interview Questions]

Q43) What is a destructor?

Ans: Destructor is an operation that frees the state of an object and/or destroys the object itself. In Java, there is no concept of destructors. It's taken care of by the JVM.

Q44) What is the base class?

Ans: The base class is the most generalized class in a class structure. Most applications have such root classes. In Java, Object is the base class for all classes.

Q45) What is a subclass?

Ans: Subclass is a class that inherits from one or more classes.

Q46) What is a superclass?

Ans: Superclass is a class from which another class inherits.

Q47) What is an ABAP data dictionary?

Ans: ABAP 4 data dictionary describes the logical structures of the objects used in application development and shows how they are mapped to the underlying relational database in tables/views.

Q48) What are the events in the ABAP/4 language?

Ans: Initialization, At selection-screen, Start-of-selection, end-of-selection, top-of-page, end-of-page, At line-selection, At user-command, At PF, Get, At New, At LAST, AT END, AT FIRST.

Q49) How to Create an Object for a Private Class?

Ans: Creating an object for the private class is not possible, but can access the private class’s static method. We can call the method using its class name and import that object. For instance, take one static method having an exporting parameter inside the private class and write the object creation code in that static method and then export that object.

Q50) Mention the major differences between the Static Class and Singleton in Sap ABAP?

Ans: Understanding static components are essential before going to static classes in Sap ABAP Static Components: Static Components such as static attributes, static methods, and static events exist globally, it’s not necessary to create an instance/object of the class to access them, simply we can access them using static component selector =>.

Singleton Class: The class that does not allow creating multiple instances to access any object.

Static Class: The class that contains only static components without instance components is referred to as a static class.

You liked the article?

Like: 3

Vote for difficulty

Current difficulty (Avg): Medium

EasyMediumHardDifficultExpert
IMPROVE ARTICLEReport Issue

About Author

Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.